feat(screenshot): Add tiled rendering to support very large screenshots (#581)#738
Conversation
|
Hey @sponce can you have a look? I think the render size check in |
|
Hi @EdwardMoyse and @sponce , I’ve updated the PR: Please let me know if you want any more adjustments. |
sponce
left a comment
There was a problem hiding this comment.
It seems you've changed the logic of the tool. the initial idea was to have the same picture as on the screen but with higher resolution if needed. 2 solutions were possible in case the ratios were different : strechting or cropping.
Now from what I see from the code, you're kind of creating a larger screen, so the resulting picture will show the screen and more. Did I misunderstood the code ?
...projects/phoenix-ui-components/lib/components/ui-menu/make-picture/make-picture.component.ts
Outdated
Show resolved
Hide resolved
...projects/phoenix-ui-components/lib/components/ui-menu/make-picture/make-picture.component.ts
Show resolved
Hide resolved
|
Thanks for the cleanup of checksize and disabled. Now there was more in the "change of logic" I was mentioning. This is about these lines for example : const scaledSize = this.croppedSize(
width,
height,
originalSize.width,
originalSize.height,
);
const heightShift = (scaledSize.height - height) / 2;
const widthShift = (scaledSize.width - width) / 2;What is was doing is to deal with the scaling factor between the screen (say 1920x1440 as an example) and the final picture (let's suppose 6000*4000). The ratio is not the same (1.33 vs 1.5) so in case the user chose the crop option, we'll have to add empty bards on the left and right. This is handled via the Shift variables. I think all that is gone now and instead of only showing what is on the screen with potential empty bars, you showing more than the screen. Am I correct ? |
|
Thanks for the detailed explanation! @sponce Yes — after reviewing my changes and your original implementation, I now understand the issue. You are correct: by removing the scaling/shift logic and only using tiling + setViewOffset, the current version is effectively rendering more than the visible screen whenever the requested aspect ratio differs from the viewport ratio. I will restore the original ratio-handling logic: I’ll push an updated commit shortly. |
|
Thanks for the detailed visual example @sponce — it helped identify the issue. |
|
I wanted to try it, but it does not compile for me : I fetched the latest version of your branch. Did you not push the right thing ? |
|
Thanks for the feedback! @sponce |
…wOffset and aspect handling
|
Hi @sponce , |
|
Thanks a lot for reviewing @sponce |
|
@EdwardMoyse the ci is failing, but it looks like it's the machinery itself, not the PR. Am I correct ? |
Not AFAIK. Other MRs are passing CI ... somehow it is related to this one. |
packages/phoenix-event-display/src/managers/three-manager/index.ts
Outdated
Show resolved
Hide resolved
|
Hi @deveshbervar - does |
…with python3 in Dockerfile
|
Hi @EdwardMoyse, thanks for the review! |






Summary
This PR implements the remaining part of Issue #581 (Problems with large screenshots).
Large screenshots previously failed due to WebGL
MAX_RENDERBUFFER_SIZElimits, causing zoomed-in or black output.The fix adds tiled screenshot rendering, allowing arbitrarily large screenshots by splitting the render into tiles and stitching them together.
What this PR adds
camera.setViewOffset()for each tileWhy this is needed
Browsers cannot render huge canvases in one pass.
Tiling bypasses WebGL size limits and fixes the incorrect export output reported in #581.
Issue Reference
Fixes #581
Thank you, and happy to iterate on feedback!